#pragma once
#include "Helper.h"
#include <IVideoDriver.h>
#include <ISceneManager.h>

namespace catan
{
	class CoordinateSystem : public IHelperBase
	{
	public:
		CoordinateSystem(void);
		~CoordinateSystem(void);
		void Draw()
		{
			irr::video::IVideoDriver* video = mHelper->GetDevice()->getVideoDriver();
			video::SMaterial mt;
			mt.Lighting=false;
			video->setMaterial(mt);

			f32 length = 100.0f;
			f32 angleLength = 10.0f;
			
			video->setTransform(video::ETS_WORLD, mHelper->GetDevice()->getSceneManager()->getRootSceneNode()->getAbsoluteTransformation());
			video::SColor color = video::SColor(255, 255,0,0);
			video->draw3DLine(core::vector3df(-length, 0.0f,0.0f), core::vector3df(length, 0.0f,0.0f), color);
			video->draw3DLine(core::vector3df(length, 0.0f, 0.0f), core::vector3df(length - angleLength, angleLength, 0.0f), color);
			video->draw3DLine(core::vector3df(length, 0.0f, 0.0f), core::vector3df(length - angleLength, -angleLength, 0.0f), color);

			color = video::SColor(255,0,255,0);
			video->draw3DLine(core::vector3df(0.0f, -length,0.0f), core::vector3df(0.0f, length, 0.0f), color);
			video->draw3DLine(core::vector3df(0.0f, length, 0.0f), core::vector3df(angleLength, length - angleLength, 0.0f), color);
			video->draw3DLine(core::vector3df(0.0f, length, 0.0f), core::vector3df(-angleLength, length - angleLength, 0.0f), color);

			color = video::SColor(255,0,0,255);
			video->draw3DLine(core::vector3df(0.0f, 0.0f, -length), core::vector3df(0.0f, 0.0f, length), color);
			video->draw3DLine(core::vector3df(0.0f, 0.0f, length), core::vector3df(angleLength, 0.0f, length - angleLength), color);
			video->draw3DLine(core::vector3df(0.0f, 0.0f, length), core::vector3df(-angleLength, 0.0f, length - angleLength), color);
		}

	};
}
